{extend name="base"/}
{block name="content"}
<div id="header-frame">
    {include file="public:top" /}
    <script type='text/javascript' src='__STATIC__/admin/uploadajax/js/jquery-2.0.3.min.js'></script>
    <script type='text/javascript' src='__STATIC__/admin/uploadajax/js/jquery.form.js'></script>
    <link href="__STATIC__/admin/uploadajax/css/style.css" type="text/css" rel="stylesheet"/>
</div>
<div id="frame-body">
    <div id="menu-frame" style="width: 100%;float: left;">
        {include file="public:menu" /}
    </div>
    <div id="main-frame" style="float: left;">
        <div id="dcMain" style="margin-left: 20px;width: 1682px;">
            <!-- 当前位置 -->
            <div id="urHere">管理中心<b>></b><strong>Banner</strong> </div>   <div id="manager" class="mainBox" style="height:auto!important;height:550px;min-height:550px;">
            <h3><a href="{:url('admin/banner/add_bannertype')}" class="actionBtn">添加Banner分类</a>Banner</h3>

            <style>
                .tableOnebor{
                    position: relative;
                }
                tr{
                    height: 40px;
                }

                .tableBasic td{
                    border-right: 1px dotted #CCCCCC;
                }
                .btn{
                    width: 100px;
                    height: 40px;
                }
                .tableBasic .tableOnebor .operation-a{
                    margin: 0 auto;
                    display:inline-block;
                    padding: 0 10px;
                    height: 24px;
                    line-height: 24px;
                    font-size: 12px;
                    color: #ffffff;
                    background: #009E94;
                    border-radius: 10px;
                    margin-right: 5px;
                }
                .mask{
                    position: absolute;
                    top:41px;
                    left: 55px;
                    width: 445px;
                    height: 500px;
                    background: rgba(255,255,255,1);
                    z-index: 10;
                    display: none;
                    text-align: center;

                }
                .hide{
                    margin: 0 auto;
                    display:inline-block;
                    padding: 0 10px;
                    height: 24px;
                    line-height: 24px;
                    font-size: 12px;
                    color: #ffffff;
                    background: #009E94;
                    border-radius: 10px;
                    margin-right: 5px;
                    cursor:pointer;
                    vertical-align: bottom;
                }
            </style>
            <table width="100%" border="0" cellpadding="8" cellspacing="0" class="tableBasic">
                <tr>
                    <td align="center" valign="top">
                        <table width="100%" border="0" cellpadding="8" cellspacing="0" class="tableOnebor">
                            <tr>
                                <td align="center" width="100">banner名称</td>
                                <td width="50" align="center">描述</td>
                                <td width="50" align="center">排序</td>
                                <td width="80" align="center">操作</td>
                            </tr>
                            {foreach name="banner" item="vo"}
                            <tr>
                                <td align="center">{$vo['banner_name']}</td>
                                <td align="center">{$vo['banner_description']}</td>
                                <td align="center">{$vo['banner_sort']}</td>
                                <td align="center"><a class="operation-a" href="{:url('admin/banner/add_bannertype')}?id={$vo['banner_id']}">编辑</a> | <a class="operation-a" href="JavaScript:" onclick="bannerm_dele('确定要{$vo['banner_states']?'下架':'上架'}吗？',{$vo['banner_id']})">{$vo['banner_states']?'下架':'上架'}</a></td>
                            </tr>
                            {/foreach}

                        </table>
                        <h3 align="center">{$banner[0]?'':'这里没有数据'}</h3>
                    </td>
                </tr>
            </table>


        </div>
        </div>
    </div>
    <script type="text/javascript">
        function bannerM_add(){
            var success_url="{:url('admin/banner/index')}";
            var url="{:url('admin/banner/add_bannerM')}";
            var admins=$("#myupload").serialize();
            $.post(url,admins,function(result){

                if(result.status=='4')
                {
                    dialog.success(result.message,success_url);
                }else
                {
                    dialog.error(result.message);
                }
            })
        }
        function bannerm_dele(message, id) {
            layer.open({
                content : message,

                icon:3,
                btn : ['是','否'],
                yes : function(){
                    var url="{:url('admin/banner/type_shelf')}";
                    var success_url="{:url('admin/banner/banner_type')}";
                    $.post(url,{'id':id},function(result){
                        if(result.status=='4')
                        {
                            dialog.success(result.message,success_url);
                        }else
                        {
                            dialog.error(result.message);
                        }
                    })
                }
            });
        }

    </script>
    {/block}